package com.yjd.bi.birthday.dao.impl;

import com.yjd.bi.birthday.dao.IBirthdayDao;
import com.yjd.bi.birthday.model.BirthdayModel;
import com.yjd.bi.birthday.model.BirthdayModelDto;
import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：微信分享红包数据访问层 <br>
 * <b>time</b>：2016-12-14 10:22:21 <br>
 * <b>author</b>： ready likun_557@163.com
 */
@Component("birthdayDao")
public class BirthdayDaoImpl extends BaseDaoImpl implements IBirthdayDao {

	private static final String SQLMAPNAMESPACE = BirthdayModel.class.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public Double getValueBySqlName(String name, Map map) {
		return (Double)this.getSqlMap(false).queryForObject(this.getStatement(name), map);
	}


	@Override
	public List<BirthdayModelDto> getValueBySqlName1(String name, Map map) {
		return this.getSqlMap(false).queryForList(this.getStatement(name), map);
	}
}
